Skip to main content

Get access token


POST /api/auth

This POST method is used to receive an access token to be used in other endpoints.

Request details

Body Parameters

ParameterTypePossible Values / FormatDescription
client_idstring(UUID v4)Unique identifier of the client in Keepz system.
client_secretstringSecret key issued to the client during onboarding. Used together with client_id to authenticate the client. Must be kept secure.
grant_typestringclient_credentialsThe OAuth 2.0 grant type being requested. Defines the flow for obtaining an access token. For server-to-server integrations, this should be client_credentials.

Headers

HeaderTypeRequiredDescription
Content-TypestringYesMust be application/json

Response details

✅ Success Response

If the request is valid, the API returns next payload:

{
"value": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"token_type": "Bearer"
}
}

Inside value object, the following parameters are available:

ParameterTypeDescription
access_tokenstringThe OAuth 2.0 access token issued by the server. Used in the Authorization: Bearer token header for all subsequent API requests.
expires_innumberLifetime of the access token in seconds. After expiry, a new token must be requested.
token_typestringThe type of token issued. Always Bearer for this API.
❌ Error Response

If an error occurs, the API returns next payload:

{
"message": "Incorrect credentials",
"statusCode": 5021
}
ParameterTypeDescription
messagestringError message. Details are provided in the dedicated section below.
statusCodenumberError status code. Details are provided in the dedicated section below.

⚠️ Important: Keep your client_secret secure and never expose it in client-side code. The access token expires after 3600 seconds (1 hour) and must be refreshed before expiry.

For more information, see the Status codes section.